fix(sanity): check REC006 only if either SampleAnnotation or ObjectAnn is not empty#239
Conversation
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
There was a problem hiding this comment.
Pull request overview
This pull request removes the REC006 sanity checker, which previously enforced that the Instance record in T4 datasets must not be empty. The change accommodates datasets that legitimately contain no sample annotations, such as certain T4 dataset cases where instance.json may be an empty array.
Key Changes:
- Removed the
REC006checker implementation and all references to it - Deleted associated test cases for the removed checker
- Updated documentation to reflect the removal of this requirement
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| t4_devkit/sanity/record/rec006.py | Deleted the entire REC006 checker implementation file |
| t4_devkit/sanity/record/init.py | Removed import of the deleted REC006 module |
| docs/schema/requirement.md | Removed REC006 entry from the requirements table |
| tests/sanity/test_record_checkers.py | Removed import statement and test functions for REC006 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
shekharhimanshu
left a comment
There was a problem hiding this comment.
LGTM. Thank you! 💯
|
Just one confirmation.
It looks like instance.json existence is conditional (based on existence of sample_annotation). Does that mean, instead of removing this rule altogether, is it better to have a conditional check or convert this to warning? |
|
@shekharhimanshu Thank you for your comments. The existence of records of
So, as you suggested, it would better for us to keep |
This reverts commit a9b763e. Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
|
In 6369902, I updated to check REC006 only if either 'SampleAnnotation' or 'ObjectAnn' is not empty. REC006: [SKIPPED]
- Both sample_annotation and object_ann records are empty
+--------------------------------------+---------+--------+--------+---------+----------+
| DatasetID | Version | Passed | Failed | Skipped | Warnings |
+--------------------------------------+---------+--------+--------+---------+----------+
| 40b478fd-6e8b-499c-b6e1-ae94744279fb | | 49 | 0 | 3 | 4 |
+--------------------------------------+---------+--------+--------+---------+----------+ |
|
Thanks for #239 (comment). can I confirm if the condition is
Will REC006 be skipped if either one of them is empty for example? |
…s not empty Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
3ad442d to
6369902
Compare
We take
No, it will be skipped only if both of them are empty.
|
|
Sounds good. Thanks for the changes and clarifications! LGTM 👍🏽 |
What
This pull request updates the logic and documentation for the
REC006schema requirement to ensure theInstancerecord is only required to be non-empty if eitherSampleAnnotationorObjectAnnrecords exist and are non-empty. The most important changes are grouped below by documentation and implementation updates.Documentation Update:
REC006indocs/schema/requirement.mdto specify that theInstancerecord must be non-empty only if eitherSampleAnnotationorObjectAnnis not empty.Implementation Updates:
REC006checker class int4_devkit/sanity/record/rec006.pyto reflect the new requirement, including an improved description and logic for skipping the check when appropriate.can_skipmethod toREC006that checks for the existence and content ofSampleAnnotationandObjectAnnfiles, allowing the check to be skipped if both are missing or empty, or if annotation files are missing.Maybe,Nothing,Some, andload_json_safe) and added type checking imports to support the new logic in the checker.Related Links
How PR Tested?
I confirmed this PR passed sanity checks using the above sample dataset:
REC006: - 'Instance' record must not be empty +--------------------------------------+---------+--------+--------+---------+----------+ | DatasetID | Version | Passed | Failed | Skipped | Warnings | +--------------------------------------+---------+--------+--------+---------+----------+ | 40b478fd-6e8b-499c-b6e1-ae94744279fb | | 48 | 1 | 2 | 4 | +--------------------------------------+---------+--------+--------+---------+----------+REC006: [SKIPPED] - Both sample_annotation and object_ann records are empty +--------------------------------------+---------+--------+--------+---------+----------+ | DatasetID | Version | Passed | Failed | Skipped | Warnings | +--------------------------------------+---------+--------+--------+---------+----------+ | 40b478fd-6e8b-499c-b6e1-ae94744279fb | | 49 | 0 | 3 | 4 | +--------------------------------------+---------+--------+--------+---------+----------+